#[doc = "Register `UART_FR` reader"]
pub struct R(crate::R<UART_FR_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<UART_FR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<UART_FR_SPEC>> for R {
    fn from(reader: crate::R<UART_FR_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "TX FIFO empty status.\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TXFE_A {
    #[doc = "0: When UART_LCR_H\\[fen\\]
is set to 0:The TX holding register is not empty.When UART_LCR_H\\[fen\\]
is set to 1:The TX FIFO is not empty."]
    NOT_EMPTY = 0,
    #[doc = "1: When UART_LCR_H\\[fen\\]
is set to 0:The TX holding register is empty.When UART_LCR_H\\[fen\\]
is set to 1:The TX FIFO is empty."]
    EMPTY = 1,
}
impl From<TXFE_A> for bool {
    #[inline(always)]
    fn from(variant: TXFE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `txfe` reader - TX FIFO empty status."]
pub struct TXFE_R(crate::FieldReader<bool, TXFE_A>);
impl TXFE_R {
    pub(crate) fn new(bits: bool) -> Self {
        TXFE_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TXFE_A {
        match self.bits {
            false => TXFE_A::NOT_EMPTY,
            true => TXFE_A::EMPTY,
        }
    }
    #[doc = "Checks if the value of the field is `NOT_EMPTY`"]
    #[inline(always)]
    pub fn is_not_empty(&self) -> bool {
        **self == TXFE_A::NOT_EMPTY
    }
    #[doc = "Checks if the value of the field is `EMPTY`"]
    #[inline(always)]
    pub fn is_empty(&self) -> bool {
        **self == TXFE_A::EMPTY
    }
}
impl core::ops::Deref for TXFE_R {
    type Target = crate::FieldReader<bool, TXFE_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "RX FIFO full status.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RXFF_A {
    #[doc = "0: When UART_LCR_H\\[fen\\]
is set to 0:The RX holding register is not full.When UART_LCR_H\\[fen\\]
is set to 1:The RX FIFO is not full."]
    NOT_FULL = 0,
    #[doc = "1: When UART_LCR_H\\[fen\\]
is set to 0:The RX holding register is full.When UART_LCR_H\\[fen\\]
is set to 1:The RX FIFO is full."]
    FULL = 1,
}
impl From<RXFF_A> for bool {
    #[inline(always)]
    fn from(variant: RXFF_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `rxff` reader - RX FIFO full status."]
pub struct RXFF_R(crate::FieldReader<bool, RXFF_A>);
impl RXFF_R {
    pub(crate) fn new(bits: bool) -> Self {
        RXFF_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RXFF_A {
        match self.bits {
            false => RXFF_A::NOT_FULL,
            true => RXFF_A::FULL,
        }
    }
    #[doc = "Checks if the value of the field is `NOT_FULL`"]
    #[inline(always)]
    pub fn is_not_full(&self) -> bool {
        **self == RXFF_A::NOT_FULL
    }
    #[doc = "Checks if the value of the field is `FULL`"]
    #[inline(always)]
    pub fn is_full(&self) -> bool {
        **self == RXFF_A::FULL
    }
}
impl core::ops::Deref for RXFF_R {
    type Target = crate::FieldReader<bool, RXFF_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "TX FIFO full status.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TXFF_A {
    #[doc = "0: When UART_LCR_H\\[fen\\]
is set to 0:The TX holding register is not full.When UART_LCR_H\\[fen\\]
is set to 1:The TX FIFO is not full."]
    NOT_FULL = 0,
    #[doc = "1: When UART_LCR_H\\[fen\\]
is set to 0:The TX holding register is full.When UART_LCR_H\\[fen\\]
is set to 1:The TX FIFO is not full."]
    FULL = 1,
}
impl From<TXFF_A> for bool {
    #[inline(always)]
    fn from(variant: TXFF_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `txff` reader - TX FIFO full status."]
pub struct TXFF_R(crate::FieldReader<bool, TXFF_A>);
impl TXFF_R {
    pub(crate) fn new(bits: bool) -> Self {
        TXFF_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TXFF_A {
        match self.bits {
            false => TXFF_A::NOT_FULL,
            true => TXFF_A::FULL,
        }
    }
    #[doc = "Checks if the value of the field is `NOT_FULL`"]
    #[inline(always)]
    pub fn is_not_full(&self) -> bool {
        **self == TXFF_A::NOT_FULL
    }
    #[doc = "Checks if the value of the field is `FULL`"]
    #[inline(always)]
    pub fn is_full(&self) -> bool {
        **self == TXFF_A::FULL
    }
}
impl core::ops::Deref for TXFF_R {
    type Target = crate::FieldReader<bool, TXFF_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "RX FIFO empty status.\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RXFE_A {
    #[doc = "0: When UART_LCR_H\\[fen\\]
is set to 0:The RX holding register is not empty.When UART_LCR_H\\[fen\\]
is set to 1:The RX FIFO is not empty."]
    NOT_EMPTY = 0,
    #[doc = "1: When UART_LCR_H\\[fen\\]
is set to 0:RX holding register empty.When UART_LCR_H\\[fen\\]
is set to 1:The RX FIFO is empty."]
    EMPTY = 1,
}
impl From<RXFE_A> for bool {
    #[inline(always)]
    fn from(variant: RXFE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `rxfe` reader - RX FIFO empty status."]
pub struct RXFE_R(crate::FieldReader<bool, RXFE_A>);
impl RXFE_R {
    pub(crate) fn new(bits: bool) -> Self {
        RXFE_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RXFE_A {
        match self.bits {
            false => RXFE_A::NOT_EMPTY,
            true => RXFE_A::EMPTY,
        }
    }
    #[doc = "Checks if the value of the field is `NOT_EMPTY`"]
    #[inline(always)]
    pub fn is_not_empty(&self) -> bool {
        **self == RXFE_A::NOT_EMPTY
    }
    #[doc = "Checks if the value of the field is `EMPTY`"]
    #[inline(always)]
    pub fn is_empty(&self) -> bool {
        **self == RXFE_A::EMPTY
    }
}
impl core::ops::Deref for RXFE_R {
    type Target = crate::FieldReader<bool, RXFE_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "UART busy/idle state.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum BUSY_A {
    #[doc = "0: The UART is idle or data transmission is complete."]
    IDLE_OR_COMPLETE = 0,
    #[doc = "1: The UART is busy transmitting data."]
    BUSY = 1,
}
impl From<BUSY_A> for bool {
    #[inline(always)]
    fn from(variant: BUSY_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `busy` reader - UART busy/idle state."]
pub struct BUSY_R(crate::FieldReader<bool, BUSY_A>);
impl BUSY_R {
    pub(crate) fn new(bits: bool) -> Self {
        BUSY_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> BUSY_A {
        match self.bits {
            false => BUSY_A::IDLE_OR_COMPLETE,
            true => BUSY_A::BUSY,
        }
    }
    #[doc = "Checks if the value of the field is `IDLE_OR_COMPLETE`"]
    #[inline(always)]
    pub fn is_idle_or_complete(&self) -> bool {
        **self == BUSY_A::IDLE_OR_COMPLETE
    }
    #[doc = "Checks if the value of the field is `BUSY`"]
    #[inline(always)]
    pub fn is_busy(&self) -> bool {
        **self == BUSY_A::BUSY
    }
}
impl core::ops::Deref for BUSY_R {
    type Target = crate::FieldReader<bool, BUSY_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl R {
    #[doc = "Bit 7 - TX FIFO empty status."]
    #[inline(always)]
    pub fn txfe(&self) -> TXFE_R {
        TXFE_R::new(((self.bits >> 7) & 0x01) != 0)
    }
    #[doc = "Bit 6 - RX FIFO full status."]
    #[inline(always)]
    pub fn rxff(&self) -> RXFF_R {
        RXFF_R::new(((self.bits >> 6) & 0x01) != 0)
    }
    #[doc = "Bit 5 - TX FIFO full status."]
    #[inline(always)]
    pub fn txff(&self) -> TXFF_R {
        TXFF_R::new(((self.bits >> 5) & 0x01) != 0)
    }
    #[doc = "Bit 4 - RX FIFO empty status."]
    #[inline(always)]
    pub fn rxfe(&self) -> RXFE_R {
        RXFE_R::new(((self.bits >> 4) & 0x01) != 0)
    }
    #[doc = "Bit 3 - UART busy/idle state."]
    #[inline(always)]
    pub fn busy(&self) -> BUSY_R {
        BUSY_R::new(((self.bits >> 3) & 0x01) != 0)
    }
}
#[doc = "UART_FR is the UART flag register.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [uart_fr](index.html) module"]
pub struct UART_FR_SPEC;
impl crate::RegisterSpec for UART_FR_SPEC {
    type Ux = u16;
}
#[doc = "`read()` method returns [uart_fr::R](R) reader structure"]
impl crate::Readable for UART_FR_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets UART_FR to value 0x0197"]
impl crate::Resettable for UART_FR_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0x0197
    }
}
